package org.emet.dao;
import org.emet.entity.biz.VehInfraccionLog;
import org.emet.jee.core.dao.Page;
import org.emet.jee.core.dao.arch.ArchDataSourceBaseDao;
import org.emet.service.dto.InfraccionLogCriteria;
import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;
@Repository
public class InfraccionLogDao extends ArchDataSourceBaseDao<VehInfraccionLog, Long> {
public Page<VehInfraccionLog> search(Page<VehInfraccionLog> page, InfraccionLogCriteria criteria) {
Criteria c = getSession().createCriteria(VehInfraccionLog.class);
NonEmptyValueHashMap<String, Object> propertyNameValues = new NonEmptyValueHashMap<String, Object>();
propertyNameValues.put("vehicleId",criteria.getVehicleId());
propertyNameValues.put("lpn",criteria.getLpn());
propertyNameValues.put("address",criteria.getAddress());
propertyNameValues.put("trafficPolice",criteria.getTrafficPolice());
propertyNameValues.put("date",criteria.getDate());
propertyNameValues.put("remark",criteria.getRemark());
c.add(Restrictions.allEq(propertyNameValues));
page.setOrderBy("id");
page.setOrder("desc");
return findPage(page, c);
}
}
